<?php
namespace app\api\validate;

use app\api\controller\Validate;

class Login extends Validate
{
    /**
     * 验证规则
     */
    protected $rule = [
        'mobile' => 'require|mobile',
        'check_code' => 'require|max:6',
        'nickname' => 'require|max:10',
    ];
    /**
     * 提示消息
     */
    protected $message = [
        'mobile.require' => '手机号不能为空',
        'mobile.mobile' => '手机号格式错误',
        'code.require' => '验证码不能为空',
        'code.max' => '验证码格式错误',
        'nickname.require' => '请填写昵称',
        'nickname.max' => '昵称最多10个字符',
    ];
    /**
     * 验证场景
     */
    protected $scene = [
        'register' => ['mobile', 'code'],
        'login' => ['mobile', 'check_code'],
        //'editUserInfo' => [ 'nickname', 'mobile'],
        'edit' => [],
    ];
}